package fzu.functiongather.Share;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.onekeyshare.OnekeyShare;
import fzu.functiongather.R;

/**
 * Created by WLT on 2016/8/5.
 */
public class ShareActivity extends Activity implements View.OnClickListener {
    private Button bt_share;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.share_main);
        initView();
        initWidget();
    }
    private void initView(){
        bt_share=(Button)findViewById(R.id.bt_share);
    }
    private void initWidget(){
        bt_share.setOnClickListener(this);
    }
    private void showShare(){
        ShareSDK.initSDK(ShareActivity.this);
        OnekeyShare oks=new OnekeyShare();
        //关闭sso授权
      /*  oks.disableSSOWhenAuthorize();
        oks.addHiddenPlatform(TencentWeibo.NAME);
        oks.addHiddenPlatform(WechatFavorite.NAME);
        oks.addHiddenPlatform(Email.NAME);
        oks.addHiddenPlatform(Facebook.NAME);
        oks.addHiddenPlatform(ShortMessage.NAME);
        oks.addHiddenPlatform(Twitter.NAME);
        oks.setUrl("https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=monline_3_dg&wd=%E7%88%B1%E6%A5%BC%E7%BD%91&oq=%E7%88%B1%E6%A5%BC%E7%BD%91&rsv_pq=977e7f4b000630f5&rsv_t=e884H3vKyd2PphlLcgLrRLYShscxLo5yu%2F%2BiYwIdttqB792uV6WEJg1Oh%2BtvhLshX6%2BK&rqlang=cn&rsv_enter=0");
        oks.setImageUrl("http://pic.58pic.com/58pic/15/48/35/36k58PICMIB_1024.png");*/
        oks.show(ShareActivity.this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.bt_share:
                showShare();
                break;
        }
    }
}
